<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>Notify 消息通知</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        .head-nav{
            display: flex;
            justify-content: space-between;
            padding: 10px;
            border-bottom: 1px solid #EEF0F4;
        }

        .list{
            margin: 20px;
        }
        .list ul li{
            list-style: none;
            height: 38px;
            line-height: 38px;
            background: #F7F8FA;
            margin: 10px 0;
            padding: 0px 10px;
            border-radius: 20px;
            font-weight: bold;
            font-size: 14px;
        }
        .list ul li:hover{
            background: #EEF0F4
        }
        .notice{
            position: fixed;
            top: -38px;
            left: 0px;
            right: 0px;
            background: red;
            height: 38px;
            line-height: 38px;
            text-align: center;
            color: #fff;
        }

      
    </style>
</head>
<body>
    <div class="head-nav">
        <div onclick="history.go(-1)">《</div>
        <div>Notify 消息通知</div>
        <div></div>
    </div>

    <div class="notice">通知内容</div>

    <div class="list">
        <div>基础用法</div>
        <ul>
            <li onclick="basicsNotice('基础用法','#EE0A24')">基础用法</li>
            <li class="testFun1 testFun2">测试点击事件</li>
        </ul>
    </div>

    <script src="https://cdn.staticfile.org/jquery/2.0.0/jquery.min.js"></script>
    <script>
        let quiver = true;
        function basicsNotice(content,color){
            if(quiver){
                quiver = false;
                $(".notice").text(content)
                $(".notice").css("background",color)
                $(".notice").animate({top:'0px'})
                setTimeout(function(){
                    $(".notice").animate({top:'-38px'})
                    quiver = true;
                },2000)
            } 
        }

        $(".testFun1").click(function(){
            console.log("testFun1")
        })
        $(".testFun2").click(function(){
            console.log("testFun2")
        })
    </script>
</body>
</html>